<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri='../dictlist.tld' prefix="dict"%>

<script type="text/javascript" src='/${requestScope.contextPath}/scripts/common.js' ></script>
<portlet:defineObjects />

<form action="<portlet:actionURL/>" name="<portlet:namespace/>Contribute" method="post">
<input name="eventId" type="hidden" />
<input name="screenId" type="hidden" value="contribute"/>
<table style="width:100%;background:#FF9">
		<tr>
			<td style="width:100%;height:50px;background:#0F3">
            Hello ${sessionScope.username}
            
            <c:if test="${sessionScope.role == -1}">
            	<div style="float:right"><input type="submit" value="Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "home");'/></div>
            	<div style="float:right"><input type="submit" value="Login" onclick='submitAction("<portlet:namespace/>", "Contribute", "login");'/></div>
            </c:if>
            <c:if test="${sessionScope.role == 0}">
            	<div style="float:right"><input type="submit" value="Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "home");'/></div>
            	<div style="float:right"><input type="submit" value="Logout" onclick='submitAction("<portlet:namespace/>", "Contribute", "logout");'/></div>
            </c:if>
            <c:if test="${sessionScope.role == 1 or sessionScope.role == 2}">
            	<div style="float:right"><input type="submit" value="Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "home");'/></div>
            	<div style="float:right"><input type="submit" value="Logout" onclick='submitAction("<portlet:namespace/>", "Contribute", "logout");'/></div>
            	<div style="float:right"><input type="submit" value="Manager Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "managerhome");'/></div>
            	<div style="float:right"><input type="submit" value="Administrator Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "adminhome");'/></div>
            </c:if>
            <c:if test="${sessionScope.role == 3}">
            	<div style="float:right"><input type="submit" value="Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "home");'/></div>
            	<div style="float:right"><input type="submit" value="Logout" onclick='submitAction("<portlet:namespace/>", "Contribute", "logout");'/></div>
            	<div style="float:right"><input type="submit" value="Administrator Home" onclick='submitAction("<portlet:namespace/>", "Contribute", "adminhome");'/></div>
            </c:if>
            </td>
      	</tr>
		<tr><td>Dictionary</td></tr>
        <tr>
            <td>
                <select name="dictID" style="width:150px">
                    <dict:dictlist/>
                </select>
            </td>
        </tr>
        <tr><td>Word</td></tr>
        <tr>
        	<td><input name="txtWord" width="200px"/></td>
        </tr>
        <tr>
        	<td>
            	<textarea name="txtMeaning" style="background:#FFF;width:600px;height:400px"></textarea>
            </td>
        </tr>
        <tr>
        	<td>
            	<input type="submit" value="Contribute" onclick='submitAction("<portlet:namespace/>", "Contribute", "contribute");'/>
                <input type="reset" value="Clear"/>
            </td>
        </tr>
        
</table>
</form>